{include file="../app/index/view/public.header.html" /}
<form class="layui-form layui-form-pane" style="padding: 16px">

    <div class="layui-form-item">
        <label class="layui-form-label" for="provinceZh">省份</label>
        <div class="layui-input-block">
            <input class="layui-input" name="provinceZh" id="provinceZh" type="text" placeholder="请输入省份"
                   autocomplete="off" lay-verify="required"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" for="leaderZh">地区</label>
        <div class="layui-input-block">
            <input class="layui-input" name="leaderZh" id="leaderZh" type="text" placeholder="请输入地区" autocomplete="off"
                   lay-verify="required"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" for="cityZh">城市</label>
        <div class="layui-input-block">
            <input class="layui-input" name="cityZh" id="cityZh" type="text" placeholder="请输入城市" autocomplete="off"
                   lay-verify="required"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" for="lon">经度</label>
        <div class="layui-input-block">
            <input class="layui-input" name="lon" id="lon" type="text" placeholder="请输入经度" autocomplete="off"
                   lay-verify="required"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" for="lat">维度</label>
        <div class="layui-input-block">
            <input class="layui-input" name="lat" id="lat" type="text" placeholder="请输入维度" autocomplete="off"
                   lay-verify="required"/>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" type="submit" lay-filter="submit" lay-submit="">提交</button>
            <button class="layui-btn" type="reset">重置</button>
        </div>
    </div>
</form>
<script type="text/javascript">
    layui.use(["layer", "form", "table", "upload", "element", "laydate"], function () {

        layui.form.on('submit(submit)', function (data) {
            postNormal("http://127.0.0.1/index.php/index/weathercity/add/", {
                    provinceZh: data.field.provinceZh,
                    leaderZh: data.field.leaderZh,
                    cityZh: data.field.cityZh,
                    lon: data.field.lon,
                    lat: data.field.lat,
                },
                function (result) {
                    closeAll();
                    if (result.code !== '1') {
                        showMessage(result.msg);
                        return;
                    }
                    showMessage("添加成功~");
                })
            return false;
        });
    });
</script>
{include file="../app/index/view/public.footer.html" /}
